package com.sphd.education.activitys;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.nostra13.universalimageloader.core.ImageLoader;
import com.sphd.education.R;
import com.sphd.education.info.SchoolTeacherImgInfo;
import com.sphd.education.modle.EducationUrl;

import butterknife.Bind;
import butterknife.ButterKnife;
/*
* 教师详细介绍
* */
public class TeacherIntroduceActivity extends AppCompatActivity {

    @Bind(R.id.toolbar)
    Toolbar toolbar;
    @Bind(R.id.image_tch)
    ImageView imageTch;
    @Bind(R.id.name_and_work)
    TextView nameAndWork;
    @Bind(R.id.tch_age)
    TextView tchAge;
    @Bind(R.id.tch_shool)
    TextView tchShool;
    @Bind(R.id.tch_introduce)
    TextView tchIntroduce;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_teacher_introduce);
        ButterKnife.bind(this);
        toolbar.setTitle("教师详情");
        setSupportActionBar(toolbar);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        toolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();//这是自带的箭头的返回的监听
            }
        });
        initView();
    }

    private void initView() {
        Intent intent = getIntent();
        SchoolTeacherImgInfo schoolTeacherImgInfo = (SchoolTeacherImgInfo) intent.getSerializableExtra("SchoolTeacherImgInfo");
        ImageLoader.getInstance().displayImage(EducationUrl.HttpTitle + "/" + schoolTeacherImgInfo.getTeacher_img_url(), imageTch);
        nameAndWork.setText(schoolTeacherImgInfo.getTeacher_name()+"\t"+schoolTeacherImgInfo.getSubject());
        tchAge.setText("教龄:"+schoolTeacherImgInfo.getTchage());
        tchShool.setText("毕业于："+schoolTeacherImgInfo.getTchSchoolName());
        tchIntroduce.setText(schoolTeacherImgInfo.getIntroduce());
    }

}
